<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  
 </head>
 <body>
  <script>
var i=1;
var sum=0;
while(i<101){
    sum += i;
    i++;
}
document.write(sum);     	//输出5050
//试试死循环
var i=10;
    while(true){
        document.write(i++);
        document.write('<br/>');
        if(i==20){
            break;      		//如果不跳出，循环将永不停息
        }
    }

  </script>
 </body>
</html>
